const Sequelize = require('sequelize')

module.exports = function (sequelize, DataTypes) {
    return sequelize.define('PlayRecord', {
        id: {
            type: DataTypes.BIGINT,
            allowNull: true,
            primaryKey: true
        },
        product_id: {
            type: DataTypes.BIGINT,
            allowNull: true
        },
        current_episode_id: {
            type: DataTypes.BIGINT,
            allowNull: true
        },
        account_id: {
            type: DataTypes.BIGINT,
            allowNull: true
        },
        learn_ids: {
            type: DataTypes.STRING(255),
            allowNull: true
        },
        pay_status: {
            type: DataTypes.STRING(255),
            allowNull: true
        },
        gmt_modified: {
            type: DataTypes.DATE,
            allowNull: true,
            defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP')
        },
        gmt_create: {
            type: DataTypes.DATE,
            allowNull: true,
            defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP')
        }
    }, {
        sequelize,
        tableName: 'play_record',
        timestamps: false
    })
}
